<?php

namespace App\Model;

use Illuminate\Support\Facades\DB;

class TemplateLayout extends BaseModel
{
    protected $table = 'template_layout';
    private $fields = [];


    public function getList($request)
    {
        $where['view_id'] = $request['view_id'] ?? 1;
        return DB::connection('api')->table($this->table)->where($where)->get();
    }



    public function createLayout($data)
    {
        return curl_request(getKkaudioApiUrl() . '/inner/template/layout/create', $data, 'urlencoded', 'GET');
    }


    public function selectLayout($data)
    {
        $d['layout_id'] = $data['layout_id'];
        $d['view_id'] = intval($data['view_id']);
        return curl_request(getKkaudioApiUrl() . '/inner/template/view/update', $d, 'urlencoded', 'GET');
    }

    public function layoutDel($data)
    {
        $d['layout_id'] = $data['layout_id'];
        return curl_request(getKkaudioApiUrl() . '/inner/template/layout/remove', $d, 'urlencoded', 'GET');
    }



}
